<template>
    <ul>
        <li v-for="item in list" :key="item.id">{{ item.title }}</li>
    </ul>
</template>

<script setup>
import { ref,watchEffect } from 'vue';
import axios from '../axios/axios.js';

const list = ref([])

const props = defineProps(['fcurrrentPage'])
console.log(props);
// props.fhandler()

watchEffect(()=>{
    axios.get('https://cnodejs.org/api/v1/topics', {
        params: { limit: 6, page: props.fcurrrentPage+1}
    }).then(res => {
        console.log(props.fcurrrentPage);
        console.log('res.data.data=>', res.data.data);
        list.value = res.data.data
    })
})


</script>

<style lang="scss" scoped></style>